Conventionally, in order to detect a rotational position of a motor shaft, constructions for mounting a rotary encoder have been proposed in which a coupling shaft is mounted to an end portion of the motor shaft, and a rotary encoder is mounted to this coupling shaft. An interfitting aperture into which the end portion of the motor shaft is inserted is disposed on the coupling shaft. The coupling shaft is mounted to the motor shaft by the end portion of the motor shaft being inserted into the interfitting aperture of the coupling shaft. A screw-threaded aperture that passes through an insertion aperture from outside the coupling shaft is disposed on the coupling shaft. The coupling shaft is fixed to the motor shaft by a set screw that is screwed into the screw-threaded aperture (See Patent Literature 1).